package com.yanqu.road.logic.activity.foxcard.game.label;

import com.yanqu.road.entity.activity.foxcard.config.FoxCardLabelConfig;
import com.yanqu.road.logic.activity.foxcard.game.FoxCardGameLogic;
import com.yanqu.road.logic.activity.foxcard.game.eFoxCardTriggerType;

public class FoxCardLabelBase implements FoxCardLabel {
    protected FoxCardLabelConfig labelConfig;
    protected eFoxCardTriggerType triggerType;

    @Override
    public FoxCardLabel init(FoxCardLabelConfig labelConfig, eFoxCardTriggerType triggerType) {
        this.labelConfig = labelConfig;
        this.triggerType = triggerType;
        return this;
    }

    protected int labelHandle(FoxCardGameLogic gameLogic) {
        return 0;
    }

    @Override
    public int handle(FoxCardGameLogic gameLogic) {
        int ret = labelHandle(gameLogic);
        //效果触发后删除标签
        if (ret > 0) {
            gameLogic.getGameData().removeLabel(labelConfig.getId());
        }
        return ret;
    }
}
